<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/community/communityYellow.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false,split:false">
	 	<form id="query-form" class="search_form clearfix">
	 			<dl>
					<dt>名称：</dt>
					<dd>
						<input name="name" id="name" type="text" class="txt" maxlength="16"/>
					</dd>
				</dl>
	            <p class="search_form_btn">
	            	<input type="button" value="搜索" class="icon_serach" onclick="admin.communityYellow.query()" />
	            </p>
	            <dl></dl>
	            <p class="search_form_btn">
	            	<input type="button" value="添加" class="icon_serach" onclick="admin.communityYellow.toAdd()" />
	            </p>
	        </form>
	   </div>
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/community/yellow/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'name',width:80,align:'center'">名称</th>
						<th data-options="field:'address',width:200,align:'center' ">地址</th>
						<th data-options="field:'phone',width:200,align:'center' ">电话</th>
						<th data-options="field:'communityName',width:200,align:'center' ">社区名称</th>
						<th data-options="field:'type',width:80,align:'center',formatter:formatType">类型</th>
						<th data-options="field:'strUpdAt',width:120,align:'center' ">最后修改时间</th>
						<th data-options="field:'strNewAt',width:120,align:'center' ">创建时间</th>
			            <th data-options="field:'id',align:'center',width:250,formatter:formatOperation">管理操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>
	<script>
		
		function formatOperation(value,row,index) {
			var l_html = '';
			l_html += '<a href="javascript:;" class="table_link" onclick="admin.communityYellow.toUpdate('+row.id+')">编辑</a>';
			l_html += '<a href="javascript:;" class="table_link" onclick="admin.communityYellow.toDelete('+row.id+')">删除</a>';
			return l_html;
		}
		
		function formatType(type) {
			var l_html = '';//交易类型idleBaseTypeEnum:1-便民;2-家政;3-购物;4-维修
			if(type==1){
				l_html="便民";
			} else if(type==2){
				l_html="家政";
			} else if(type==3){
				l_html="购物";
			} else if(type==4){
				l_html="维修";
			} 
			return l_html;
		}
	</script>
  </body>
</html>
